package castle.defense.project;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;

public class ImmobileWeapon extends Weapon {
	PhysicsPoint point;
	Paint paint;
	public ImmobileWeapon(PhysicsPoint p, double attackSpeed, int attackDamage, double range, double size, double projectileSpeedPercent, int color, boolean offensive, int attackSound, boolean visible) {
		super(attackSpeed, attackDamage, range, size, projectileSpeedPercent, color, offensive, attackSound, visible);
		this.point = p;
		this.paint = new Paint();
		paint.setColor(Color.RED);
		paint.setStyle(Style.FILL);
	}
	
	/**
	 * first two params are useless, x and y are proper end locations
	 */
	public Projectile attack(double x, double y) {
		return super.attack(point.x,point.y,x,y);
//		if(canAttack()) {
//			this.makeSound();
//			timeElapsed = 0;
//			double angle = Math.atan2(y-point.getY(), x-point.getX());
//			Projectile p = new Projectile(point.getX(), point.getY(), projectileSpeed(projectileSpeed, angle),angle,size,attackDamage,offensive,visibleProj);
//			p.setColor(color);
//			return p;
//		}
//		return null;
	}
	
	public void draw(Canvas c) {
		c.drawRect(PE.screenRegion(point.getX()-size, point.getY()-size, point.getX()+size, point.getY()+size), paint);
	}
}
